From 063aa7f82329f9aa3e9a1a92968954602192fa35 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 14 Jul 2009 14:43:19 +0100 Subject: [PATCH] python: Remove tab indents. Signed-off-by: Keir Fraser --- tools/python/xen/web/SrvBase.py | 6 ++--- tools/python/xen/web/SrvDir.py | 2 +- tools/python/xen/xend/PrettyPrint.py | 10 ++++----- tools/python/xen/xend/XendConfig.py | 28 ++++++++++++------------ tools/python/xen/xend/encode.py | 2 +- tools/python/xen/xend/osdep.py | 11 +++++----- tools/python/xen/xend/server/pciquirk.py | 4 ++-- tools/python/xen/xend/sxp.py | 2 +- tools/python/xen/xm/create.py | 2 +- tools/python/xen/xm/main.py | 24 ++++++++++---------- 10 files changed, 45 insertions(+), 46 deletions(-) diff --git a/tools/python/xen/web/SrvBase.py b/tools/python/xen/web/SrvBase.py index bf59b556c8..cabb7b119f 100644 --- a/tools/python/xen/web/SrvBase.py +++ b/tools/python/xen/web/SrvBase.py @@ -30,7 +30,7 @@ import httpserver def uri_pathlist(p): """Split a path into a list. - p path + p path return list of path elements """ l = [] @@ -51,7 +51,7 @@ class SrvBase(resource.Resource): """Get the method for an operation. For operation 'foo' looks for 'op_foo'. - op operation name + op operation name returns method or None """ op_method_name = 'op_' + op @@ -67,7 +67,7 @@ class SrvBase(resource.Resource): and an HTML string otherwise (or list). Methods may also return a ThreadRequest (for incomplete processing). - req request + req request """ op = req.args.get('op') if op is None or len(op) != 1: diff --git a/tools/python/xen/web/SrvDir.py b/tools/python/xen/web/SrvDir.py index 807da69b3a..006975ef79 100644 --- a/tools/python/xen/web/SrvDir.py +++ b/tools/python/xen/web/SrvDir.py @@ -37,7 +37,7 @@ class SrvConstructor: """Create a constructor. It is assumed that the class should be imported as 'from xen.xend.server.klass import klass'. - klass name of its class + klass name of its class """ self.klass = klass self.obj = None diff --git a/tools/python/xen/xend/PrettyPrint.py b/tools/python/xen/xend/PrettyPrint.py index 48135771ac..22a78fb3f2 100644 --- a/tools/python/xen/xend/PrettyPrint.py +++ b/tools/python/xen/xend/PrettyPrint.py @@ -284,9 +284,9 @@ class SXPPrettyPrinter(PrettyPrinter): def prettyprint(sxpr, out=sys.stdout, width=80): """Prettyprint an SXP form. - sxpr s-expression - out destination - width maximum output width + sxpr s-expression + out destination + width maximum output width """ if isinstance(sxpr, types.ListType): pp = SXPPrettyPrinter(width=width) @@ -299,8 +299,8 @@ def prettyprint(sxpr, out=sys.stdout, width=80): def prettyprintstring(sxpr, width=80): """Prettyprint an SXP form to a string. - sxpr s-expression - width maximum output width + sxpr s-expression + width maximum output width """ io = StringIO.StringIO() prettyprint(sxpr, out=io, width=width) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 3784b36553..0871d9ac8a 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1437,20 +1437,20 @@ class XendConfig(dict): if dev_uuid not in target['console_refs']: target['console_refs'].append(dev_uuid) - # Cope with old-format save files which say under vfb - # (type vfb) rather than (vfb 1) - try: - vfb_type = dev_info['type'] - except KeyError: - vfb_type = None - log.debug("iwj dev_type=%s vfb type %s" % - (dev_type, `vfb_type`)) - - if vfb_type == 'vnc' or vfb_type == 'sdl': - dev_info[vfb_type] = 1 - del dev_info['type'] - log.debug("iwj dev_type=%s vfb setting dev_info['%s']" % - (dev_type, vfb_type)) + # Cope with old-format save files which say under vfb + # (type vfb) rather than (vfb 1) + try: + vfb_type = dev_info['type'] + except KeyError: + vfb_type = None + log.debug("iwj dev_type=%s vfb type %s" % + (dev_type, `vfb_type`)) + + if vfb_type == 'vnc' or vfb_type == 'sdl': + dev_info[vfb_type] = 1 + del dev_info['type'] + log.debug("iwj dev_type=%s vfb setting dev_info['%s']" % + (dev_type, vfb_type)) # Create serial backends now, the location value is bogus, but does not matter i=0 chardev=0 diff --git a/tools/python/xen/xend/encode.py b/tools/python/xen/xend/encode.py index 3e541b4d9f..f47c18a1be 100644 --- a/tools/python/xen/xend/encode.py +++ b/tools/python/xen/xend/encode.py @@ -97,7 +97,7 @@ def encode_data(d): """Encode some data for HTTP transport. The encoding used is stored in 'Content-Type' in the headers. - d data - sequence of tuples or dictionary + d data - sequence of tuples or dictionary returns a 2-tuple of the headers and the encoded data """ val = ({}, None) diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py index ce611a2982..5d5cea6fff 100644 --- a/tools/python/xen/xend/osdep.py +++ b/tools/python/xen/xend/osdep.py @@ -72,12 +72,11 @@ def _linux_balloon_stat_sysfs(label): return None def _linux_balloon_stat(label): - if os.access(PROC_XEN_BALLOON, os.F_OK): - return _linux_balloon_stat_proc(label) - elif os.access(SYSFS_XEN_MEMORY, os.F_OK): - return _linux_balloon_stat_sysfs(label) - - return None + if os.access(PROC_XEN_BALLOON, os.F_OK): + return _linux_balloon_stat_proc(label) + elif os.access(SYSFS_XEN_MEMORY, os.F_OK): + return _linux_balloon_stat_sysfs(label) + return None def _solaris_balloon_stat(label): """Returns the value for the named label, or None if an error occurs.""" diff --git a/tools/python/xen/xend/server/pciquirk.py b/tools/python/xen/xend/server/pciquirk.py index 71e9410d80..eda3d1d459 100644 --- a/tools/python/xen/xend/server/pciquirk.py +++ b/tools/python/xen/xend/server/pciquirk.py @@ -37,10 +37,10 @@ class PCIQuirk: if id.startswith(self.devid[:9]): # id's vendor and device ID match skey = id.split(':') size = len(skey) - if (size == 2): # subvendor/subdevice not suplied + if (size == 2): # subvendor/subdevice not suplied ret = True break - elif (size == 4): # check subvendor/subdevice + elif (size == 4): # check subvendor/subdevice # check subvendor subven = '%04x' % self.subvendor if ((skey[2] != 'FFFF') and diff --git a/tools/python/xen/xend/sxp.py b/tools/python/xen/xend/sxp.py index a9e9adf17f..c5a2e2a9f3 100644 --- a/tools/python/xen/xend/sxp.py +++ b/tools/python/xen/xend/sxp.py @@ -730,7 +730,7 @@ def all_from_string(s): def parse(io): """Completely parse all input from 'io'. - io input file object + io input file object returns list of values, None if incomplete raises ParseError on parse error """ diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index beda32ad89..6ee6b7010d 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -367,7 +367,7 @@ gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,displa given DISPLAY and XAUTHORITY, which default to the current user's ones. OpenGL will be used by default unless opengl is set to 0. keymap overrides the XendD configured default layout file. - Serial adds a second serial support to qemu. + Serial adds a second serial support to qemu. Monitor adds a backend for the stubdom monitor.""") gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \ diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index 30b1ceff45..e557429d3d 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1794,8 +1794,8 @@ def xm_console(args): for (k, v) in options: if k in ['-q', '--quiet']: quiet = True - elif k in ['-n', '--num']: - num = int(v[0]) + elif k in ['-n', '--num']: + num = int(v[0]) else: assert False @@ -2227,15 +2227,15 @@ def xm_pci_list(args): return def f(x): - # The vfunc shouldn't be used for ordering if the vslot hasn't been - # assigned as the output looks odd beacuse the vfunc isn't reported - # but the (physical) function is. - if x['vdevfn'] & AUTO_PHP_SLOT: - vdevfn = AUTO_PHP_SLOT - else: - vdevfn = x['vdevfn'] - return (vdevfn << 32) | \ - PCI_BDF(x['domain'], x['bus'], x['slot'], x['func']) + # The vfunc shouldn't be used for ordering if the vslot hasn't been + # assigned as the output looks odd beacuse the vfunc isn't reported + # but the (physical) function is. + if x['vdevfn'] & AUTO_PHP_SLOT: + vdevfn = AUTO_PHP_SLOT + else: + vdevfn = x['vdevfn'] + return (vdevfn << 32) | \ + PCI_BDF(x['domain'], x['bus'], x['slot'], x['func']) devs.sort(None, f) has_vdevfn = False @@ -2561,7 +2561,7 @@ def xm_pci_attach(args): vslot = PCI_SLOT(vdevfn) for i in dev: i['vdevfn'] = '0x%02x' % \ - PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16))) + PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16))) for i in dev: xm_pci_attach_one(dom, i) -- 2.30.2